<template>
    <div>
        <el-container style="height: 840px; border: 1px solid #eee">
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
            <el-menu :default-openeds="['1']" :router=true>
                <el-menu-item index="/myNews"><a class="el-icon-view">查看我的新闻</a></el-menu-item>
                <el-menu-item index="/modify"><a class="el-icon-s-order">修改个人信息</a></el-menu-item>
                <!-- <el-menu-item index="/comments"><a class="el-icon-s-order">查看历史评论新闻</a></el-menu-item> -->
            </el-menu>
        </el-aside>

        <el-container>
            <el-header style="text-align: right; font-size: 12px">
            <el-button type="primary" icon="el-icon-d-arrow-left" plain v-on:click="returnMain()">返回</el-button>
            </el-header>

            <el-main>
            <router-view/>
            </el-main>
        </el-container>
        </el-container>
    </div>
</template>

<script>
export default {
    name:"PersonalSpace",
    methods:{
        returnMain(){
          this.$router.push("/mainTable");
      }
    },

    created(){
      var userString = localStorage.getItem("user");
      if (userString) {
                this.user = JSON.parse(userString);
      }
      //获取财经新闻
      this.$router.push("/myNews");
  }
    
}
</script>

<style>
    .el-header {
    background-color: #b3c0d1;
    color: #333;
    line-height: 60px;
    }

    .el-aside {
    color: #333;
    }
</style>